package com.sainan114.pipelinestudy.strategy;

import com.sainan114.pipelinestudy.StrategyFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

/**
 * @author lgb
 * @Date: 2021/7/9
 */
@Component
public abstract class AbstractStrategy implements InitializingBean {

    public void startStrategy() {
        // 实现日志相关的内容
        baseProcess();
    }

    public abstract void baseProcess();

    @Override
    public void  afterPropertiesSet() {
        StrategyFactory.registerBean(this.getClass().getSimpleName(), this);
    }
}
